﻿/*
 * ============ [ 废土 ] ============
 *
 * [ 维护者 ]  argoran@gmail.com
 * [  状态  ]  原型
 *
 * ============ [ 注释 ] ============
 *
 * 服务器端程序计时器事件处理代码
 *
 * ==================================
 */

using System;

using LastLand.Core.TimerEvtProcessor;
using LastLand.Data.Global;

using Up2Link.SegString;

namespace LastLand.Core
{
    public class CTimerEvent
    {
        private ITimerEventProcessor timerEvtProc_;

        public void ProcessTimerEvent(Int32 _index, CMessageSS _event)
        {
            Int32 evtCode = _event.MsgCode;

            switch (evtCode)
            {
                case CConst.EVENT_COMBAT_UPDATE_COUNTER:
                    timerEvtProc_ = new CEvtUpdateCombat();
                    break;
                case CConst .EVENT_WORLD_UPDATE_COUNTER:
                    timerEvtProc_ = new CEvtUpdateWorld();
                    break;
                case CConst.EVENT_CHARACTER_UPDATE_COUNTER:
                    timerEvtProc_ = new CEvtUpdateCharacter();
                    break;
                default:
                    timerEvtProc_ = new CEvtDefault();
                    break;
            }
            timerEvtProc_.ProcessTimerEvent(_index, _event);
        }
    }
}
